package com.tangula.web.kashine.business;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tangula.web.kashine.entity.SupportEntity;
import com.tangula.web.kashine.repository.SupportEntityRepository;
@Service
public class SupportBusinessImpl implements SupportBusiness{
	@Autowired
	SupportEntityRepository supportRepository;
	@Override
	public SupportEntity saveSupport(SupportEntity support) {
		if(support!=null) {
			support.setSupportTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
			return supportRepository.saveAndFlush(support);
		}else {
			return null;
		}
	}

}
